{% extends 'base.html' %}
{% load staticfiles %}
{% block title %}琢越网{% endblock %}

{% block custom_js %}<script src="{% static 'js/jquery-3.3.1.min.js' %}"></script>{% endblock %}
{% block custom_css %}<link rel="stylesheet" href="{% static 'css/mystyle.css' %}">{% endblock %}

{% block content %}
    <div class="col-md-12 column">
        <div class="row clearfix main-bk">
            <br></br>
            <br></br>
            <div class="col-md-8 column"> <!超大屏幕>
                <div class="jumbotron" style="background-color:rgba(255,255,255,0.45);padding-left:30px;padding-right:30px"> <!超大屏幕>
                    <h1>
                        welcome
                    </h1>
                    <p>琢越网让你不再白学！</p>
                    <p>在这里你可以共享资源、讨论学术、答疑解惑、交友聊天……</p>
                    <p> <a class="btn btn-warning btn-primary btn-large" href="{% url 'topic:index' %}">开始学习</a> </p>
                </div>
                <br></br>

            </div>
            <div class="col-md-4 column white-bk"><!登录框>
                <form action="{% url 'login' %}" method="post" class="form-horizontal" role="form" >
                <fieldset>
                <legend style="line-height:250%;color:black;font-weight:900;text-align:center;">登&nbsp;&nbsp;录</legend>
                    <div class="form-group marb20 {% if login_form.errors.username %}errorput{% endif %}">
                         <label for="e-mail" class="col-sm-2 control-label">邮&nbsp;&nbsp;箱</label>
                        <div class="col-sm-9">
                            <input name="username" class="form-control" id="e-mail" type="" />
                        </div>
                        <p id="e-mailInfo"></p>
                    </div>
                    <div class="form-group marb8 {% if login_form.errors.password %}errorput{% endif %}">
                         <label for="password" class="col-sm-2 control-label">密&nbsp;&nbsp;码</label>
                        <div class="col-sm-9">
                            <input name="password" class="form-control" id="password" type="password" />
                        </div>
                    </div>
                    <div class="error btns login-form-tips" id="jsLoginTips">
                        {% for key,error in login_form.errors.items %}
                            {{ error }}
                        {% endfor %}
                        {{ msg }}
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-1 col-sm-5">
                            <div class="checkbox">
                                 <label><input type="checkbox" />记住密码</label>
                            </div>
                        </div>
                        <div class="col-sm-offset-2 col-sm-4">
                            <a href="{% url 'forget_pwd' %}" ><p style="color:red">忘记密码</p></a>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-5 col-sm-20">
                             <button onclick="validLogin()" type="submit" class="btn btn-warning btn-default">登录</button>
                        </div>
                    </div>
                </fieldset>
                {% csrf_token %}
                </form>
            </div>
            <br></br>
            <br></br>
        </div>
    </div>
{% endblock %}
{% block custom_script %}
{% endblock %}